@layout("/common/_container.html"){
<script>
    var all = 0;
</script>
<div class="ibox float-e-margins">
    <div class="ibox-content">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>${title}款项确认</h5>
            </div>
        </div>
        <input type="hidden" id="id" value="${item.id}">
        <input type="hidden" id="mode" value="${item.mode}">
        <input type="hidden" id="is_transfer" value="${item.isTransfer}">
        <input type="hidden" id="sendDeptName" value="${item.sendDeptName}">
        <input type="hidden" id="dotId" value="${item.dotId}">
        <div class="row">
            <hr class="layui-bg-gray" style="height: 3px">
            <div class="col-sm-3" style="text-align:center">
                <div class="row mar">
                    单号：${item.original_num}
                </div>
                <div class="row mar">
                    收货人：${item.consignee}
                </div>
                <div class="row mar">
                    物品名称：${item.goodsName}
                </div>
                <div class="row mar">
                    提付：<span id="tfsp">0</span>
                </div>
                <div class="row mar">
                    回单：${item.receipt}
                </div>
                <div class="row mar">
                    备注：备
                </div>
            </div>
            <div class="col-sm-3" style="text-align: center">
                <div class="row mar">
                    交货方式：
                    @if(item.isTransfer==1){
                    中转
                    @}else if(item.mode==0){
                    自提
                    @}else{
                    配送
                    @}

                </div>
                <div class="row mar">
                    联系号码：${item.receivingPhone}
                </div>
                <div class="row mar">
                    重量/T：${item.goodsWeight}
                </div>
                <div class="row mar">
                    代收货款：<span id="dshk">0</span>
                </div>
                <div class="row mar">
                    库存时长：${days}
                </div>

            </div>
            <div class="col-xs-3" style="text-align: center">

                <div class="row mar">
                    入库时间：${inTime}

                </div>
                <div class="row mar">
                    收货地址：${item.receivingAddress}
                </div>
                <div class="row mar">
                    体积/M3：${item.goodsVolume}
                </div>
                <div class="row mar">
                    仓储费：<span id="csf">0</span>
                </div>

            </div>
            <div class="col-xs-3" style="text-align: center">
                <div class="row mar">
                    状态：
                    @if(item.status==1){
                    待出库
                    @}else if(item.status==0){
                    审核中
                    @}else if(item.status==2){
                    已出库
                    @}else{
                    完成
                    @}

                </div>
                <div class="row mar">
                    件数：${item.collection}
                </div>
                <div class="row mar">
                    落地费：<span id="ldf">0</span>
                </div>
                <div class="row mar">
                    搬运费：<span id="byf">0</span>
                </div>
            </div>
        </div>
        <hr class="layui-bg-gray" style="height: 3px">
        <div class="row" style="margin-top: 10px">
            <div class="col-sm-6" style="text-align:left">
               <img src="${ctxPath}/static/img/user.png" > ${item.consignee} 应付（￥）：<input id="sz_money" type="text" readonly style="border: none;color: #00B83F">
            </div>
        </div>
        <div class="row" style="margin-top: 10px">

            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label" style="width: 90px;text-align: left">现金：</label>
                    <div class="layui-input-inline" style="width: 140px;">
                        <input type="text" name="cash" id="cash" placeholder="" value="0" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label" style="width: 100px;">微信收入：</label>
                    <div class="layui-input-inline" style="width: 140px;">
                        <input type="text" name="weixin" id="weixin" placeholder="" value="0" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label" style="width: 100px;">银卡收入：</label>
                    <div class="layui-input-inline" style="width: 140px;">
                        <input type="text" name="bank" id="bank" placeholder="" value="0" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label" style="width: 115px;">支付宝收入：</label>
                    <div class="layui-input-inline" style="width: 140px;">
                        <input type="text" name="alipay" id="alipay" placeholder="" value="0" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>

        </div>
        <div class="row" style="margin-top: 5px">

            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label" style="width: 90px;text-align: left">提货人：</label>
                    <div class="layui-input-inline" style="width: 140px;">
                        <input type="text" name="reallyUser" id="reallyUser" placeholder="" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label" style="width: 100px;">身份证号：</label>
                    <div class="layui-input-inline" style="width: 140px;">
                        <input type="text" name="reallyPhone" id="reallyPhone" placeholder="" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>

        </div>
        <div class="row" style="margin-top: 5px">

            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label" style="width: 100px;text-align: left">备注：</label>
                    <div class="layui-input-inline" style="width: 280px;">
                        <input type="text" name="mark" id="mark" placeholder="" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>

        </div>
        <div style="display: none">
            <div class="row">
                <div class="col-sm-12" style="text-align: left">
                    选择费用项目：
                </div>
            </div>
            <div class="row">
                <input type="hidden" id="transfer_name" value="${item.transfer_name}">
                @for(fee in list){
                <div class="col-sm-1" style="text-align: left;width: 127px">
                    <div class="checkbox checkbox">
                        <input id="${fee.id}_check" class="styled" type="checkbox" name="is_out" value="${fee.id}"
                               onchange="TOrderInfoDlg.addLine(this.value,this)"
                        >
                        <label for="${fee.id}_check" class="font-bolder">
                            ${fee.fee_name}
                        </label>
                    </div>
                </div>
                <input type="hidden" id="${fee.id}_type" value="${fee.payments_type}">
                <input type="hidden" id="${fee.id}_object" value="${fee.use_object}">
                <input type="hidden" id="${fee.id}_labe" value="${fee.fee_name}">
                @}
            </div>
            <table class="table-striped layui-table mtd" id="table" style="width: 100%;border: 1px solid darkgrey">
                <thead>
                <td>款项</td>
                <td>收支</td>
                <td>交易对象</td>
                <td>金额</td>
                <td>结算方式</td>
                <td>操作</td>
                </thead>
                @for(feeOrder in feeOrders){
                <tr id="${feeOrder.fee_id}_tr">

                        @if(feeOrder.fee_id==1 || feeOrder.fee_id==37){
                            <script>
                                var a="${feeOrder.money}";
                                a=(a==null?'0':a)
                                var b=$('#tfsp').html()
                                b=(b==null?'0':$('#tfsp').html())
                                $('#tfsp').text(parseFloat(b)+parseFloat(a))
                            </script>
                        @}else if(feeOrder.fee_id==29 || feeOrder.fee_id==40 ){
                            <script>
                                var a="${feeOrder.money}";
                                a=(a==null?'0':a)
                                var b=$('#csf').html()
                                b=(b==null?'0':$('#csf').html())
                                $('#csf').text(parseFloat(b)+parseFloat(a))
                            </script>
                        @}else if(feeOrder.fee_id==28 || feeOrder.fee_id==39 ){
                            <script>
                                var a="${feeOrder.money}";
                                a=(a==null?'0':a)
                                var b=$('#byf').html()
                                b=(b==null?'0':$('#byf').html())
                                $('#byf').text(parseFloat(b)+parseFloat(a))
                            </script>
                        @}else if(feeOrder.fee_id==2 || feeOrder.fee_id==38){
                        <script>
                            var a="${feeOrder.money}";
                            a=(a==null?'0':a)
                            var b=$('#dshk').html()
                            b=(b==null?'0':$('#dshk').html())
                            $('#dshk').text(parseFloat(b)+parseFloat(a))
                        </script>
                    @} else if(feeOrder.fee_id==41 || feeOrder.fee_id==42){
                    <script>
                        var a="${feeOrder.money}";
                        a=(a==null?'0':a)
                        var b=$('#ldf').html()
                        b=(b==null?'0':$('#ldf').html())
                        $('#ldf').text(parseFloat(b)+parseFloat(a))
                    </script>
                    @}
                    <td>${feeOrder.fee_name}</td>
                    <td>${feeOrder.feeIncome}
                        <input value="${feeOrder.fee_Income}" id="${feeOrder.fee_id}_ff" type="hidden">
                    </td>
                    <td>
                        @if(feeOrder.use_object == "3"){
                        ${item.consignee}
                        <input value="${feeOrder.money}" name="js_money" type="hidden">
                        @}else if(feeOrder.use_object == "2"){
                        ${item.sendDeptName}
                        @}else if(feeOrder.use_object == "4"){
                        ${item.transfer_name}
                        @}else if(feeOrder.use_object == "5"){
                        ${item.reallyUser}
                        @}
                        <input value="${feeOrder.fee_id}" name="feeId" type="hidden" id="${feeOrder.fee_id}">
                        <input value="${feeOrder.use_object}" type="hidden" id="${feeOrder.fee_id}_use_object">
                    </td>
                    <td>
                        @if(feeOrder.audit_status==0){
                        @if(feeOrder.use_object == "3"){
                        <input value="${feeOrder.money}" name="cur_money" id="${feeOrder.fee_id}_m" type="text"
                               onkeyup="TOrderInfoDlg.changeMoney(${feeOrder.fee_id})">
                        @}else{
                        <input value="${feeOrder.money}" name="cur_money" id="${feeOrder.fee_id}_m" type="text">
                        @}

                        @}else{
                        <input value="${feeOrder.money}" name="cur_money" id="${feeOrder.fee_id}_m" type="text"
                               readonly>
                        @}

                        <input value="${feeOrder.sy}" id="${feeOrder.fee_id}_t" type="hidden">

                    </td>
                    <td>
                        @if(feeOrder.audit_status==0){
                        @if(feeOrder.use_object == "3"){
                        <select id="${feeOrder.fee_id}_s" onchange="TOrderInfoDlg.Calculation()">
                            <option value="0" selected="selected">当场结算</option>
                            <option value="1">等待月结</option>
                        </select>
                        @}else{
                        <select id="${feeOrder.fee_id}_s">
                            <option value="0" selected="selected">当场结算</option>
                            <option value="1">等待月结</option>
                        </select>
                        @}

                        @}else{
                        ${feeOrder.settlementType}
                        <input value="1" id="${feeOrder.fee_id}_s" type="hidden">
                        @}
                    </td>
                    <td>
                        @if(feeOrder.audit_status==0){
                        <button class="btn-danger" onclick="TOrderInfoDlg.delLine(${feeOrder.fee_id})">删除</button>
                        @}
                    </td>
                </tr>
                @}
            </table>


        </div>

        <div class="row" style="display: none">
            <div class="col-sm-2" style="text-align: right">
                合计收支（￥）：
            </div>
            <div class="col-sm-10" style="text-align: left">
                <input id="all_money" type="text" readonly style="border: none">
            </div>
        </div>
        <div class="row" style="display: none">
            <div class="col-sm-2" style="text-align: right">
                ${item.consignee} 收支（￥）：
            </div>
            <div class="col-sm-2" style="text-align: right;display: none">
                ${item.consignee} 挂账（￥）：
            </div>
            <div class="col-sm-6" style="text-align: left">
                <input id="gz_money" type="text" readonly style="border: none;display: none">
            </div>
        </div>
        <div class="row" style="margin-top: 10px;display: none;">
            <div class="col-sm-3">
                <#SelectCon id="pay_mode" name="付款方式" >
                    <option value="0">现金</option>
                    <option value="1">支付宝</option>
                    <option value="2">微信</option>
                    <option value="3">银行转账</option>
                    <option value="4">其他</option>
                </#SelectCon>
            </div>
        </div>
        <div class="form-horizontal" id="dotInfoForm">

            <div class="row">

            </div>
            <div class="row btn-group-m-t">
                <div class="col-sm-10" style="text-align: center">

                    @if(item.status==1){
                    <#button btnCss="info" name="确认出库,打印" id="ensure" icon="fa-check" clickFun="TOrderInfoDlg.addSubmit(0)"/>
                    <#button btnCss="info" name="确认出库,不打印" id="ensure" icon="fa-check" clickFun="TOrderInfoDlg.addSubmit(1)"/>
                    @}else{
                    <#button btnCss="info" name="打印" id="ensure" icon="fa-check" clickFun="TOrderInfoDlg.print()"/>
                    @}

                    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TOrderInfoDlg.close()"/>
                </div>
            </div>
        </div>

    </div>
</div>
<style>
    table {
        table-layout: fixed;
        word-wrap: break-word;
    }

    .mtd td {
        height: 30px;
        border: #CCCCCC 1px solid;
        text-align: center
    }

    table input {
        border: none;
        height: 100%;
        background-color: transparent;

    }

    table select {
        border: none;
        height: 100%;
        background-color: transparent;
    }

    .mar {
        margin: 8px;
        text-align: left;
    }
</style>
<script src="${ctxPath}/static/modular/system/tOrder/tOrder_library_info.js"></script>
@}
